package com.cheer.job;

import cn.hutool.core.io.FileUtil;
import com.cheer.service.ReferencePlacesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.io.File;

/**
 * 题库定时任务，清理从表脏数据以及io脏数据文件
 *
 * @author chufangzheng 2019/3/15
 */
@Component
public class PlaceJob {

    private static final Logger LOGGER = LoggerFactory.getLogger(PlaceJob.class);

    @Autowired
    private ReferencePlacesService referencePlacesService;

    /**
     * 创建名额 每年执行一次
     */
    @Scheduled(cron = "0 0 0 0 0 ? *")
    public void repositoryClean() {
        LOGGER.info("----开始创建省级名额----");
        referencePlacesService.createPlaces();
        LOGGER.info("----省级名额创建完成----");
    }

}
